﻿<!--#include file="inc/conn.asp"-->
<!--#include file="inc/md5.asp"-->
<%
uid = request("id")
If uid = "" Or IsNull(uid) Or Not IsNumeric(uid) Then
	response.end
End If
Call OpenData()
set rs = server.CreateObject("adodb.recordset")
sql = "select * from sexy where id = "&uid
rs.open sql,conn,1,1
if not (rs.eof and rs.bof) then
		'ID = rs("ID")
		Name = rs("Name")
		City = rs("City")
		age = rs("age")
		height = rs("Height")
		weight = rs("weight")
		price = rs("Price")
		tel = rs("Tel")
		qq = rs("QQ")
		photopath = rs("photopath")
		if photopath <> "" then
			photoArr = split(photopath,"|")
			headpic = PhotoArr(0)
		else
			headpic = ""
		end if
end if
rs.close
set rs = Nothing
%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="description" content="<%=Name%>，<%=Replace(city,"市","")%>保健按摩，<%=price%>/小时">
	<title><%=Name%> - <%=Replace(city,"市","")%>保健按摩</title>
	<link rel="stylesheet" href="<%=sitepath%>theme/css/main.css">
	<!--[if IE]><script src="<%=sitepath%>js/html5.js"></script><![endif]-->
</head>
<%
'sqlMsg
sqlMsg = sqlMsg & "select id,username,email,website,content,posttime from [message] where uid ="&CLng(uid)
sqlMsg = sqlMsg & " order by posttime desc"
'response.write sqlMsg :response.end
set rsMSG = server.CreateObject("adodb.recordset")
rsMSG.open sqlMsg,conn,1,1
If Not rsMSG.eof Then
	'分页
	dim currentpage
	maxperpage=30 '信息显示条数
	rsMSG.pagesize=maxperpage
	currentpage=request.queryString("p")
	if currentpage="" or not isnumeric(currentpage) then
		currentpage=1
	elseif currentpage<1 then
		currentpage=1
	else
		currentpage=clng(currentpage)
		if currentpage > rsMSG.pageCount Then currentpage=rsMSG.pageCount
	end if
				  
	dim totalput,n
	totalput=rsMSG.recordcount
	if totalput mod maxperpage=0 then
		n=totalput\maxperpage
	else
		n=totalput\maxperpage+1
	end if
	if n = 0 then n = 1
	rsMSG.move(currentpage-1)*maxperpage
	i = 0
	do while i < maxperpage and not rsMSG.eof
		id = rsMSG("id")
		username = rsMSG("username")
		email = md5(rsMSG("email"),32)
		posttime = rsMSG("posttime")
		website = rsMSG("website")
		content = rsMSG("content")
		formatTime = EnStrDate(posttime)
		isoTime = Year(posttime) & "-" & Month(posttime) & "-" & Day(posttime) & "T" & Hour(posttime) & ":" & Minute(posttime) & "-" & Second(posttime) & ":00" 
		If website = "" Then 
			website = "#"
		End If
			strMSG = strMSG & "<li><a href='"& website &"' class='avatar'><img alt='"& username &"' src='http://www.gravatar.com/avatar/"&email&"'></a><div class='detail'><p><a href='"& website &"' class='fn url'>"& username &"</a>于<time datetime='"& isoTime &"'>"& formatTime &"</time></p><p class='says'>"& content &"<i class='arrow larr'></i><i class='arrow larr-in'></i></p></div></li>"
		i=i+1      
		rsMSG.movenext
	Loop
Else
	strMSG = "<li>还没有评论...</li>"
End if
rsMSG.close:set rsMSG = nothing
'page
pageCount = n
If currentpage>1 Then 
	pageStr = pageStr & "<a href='?p="&currentpage-1&qStr&"'>&laquo; Previous</a>"
Else
	pageStr = pageStr & "<span class='disabled'>&laquo; Previous</span>"
End if
If pageCount<=10 Then
	For i = 1 To pageCount
		If i = currentpage Then 
			pageStr = pageStr & "<span class='current'>"&i&"</span>"
		Else
			pageStr = pageStr & "<a href='?p="&i&qStr&"'>"&i&"</a>"
		End if
	Next
else
	For i = 1 To 2
		If i = currentpage Then 
			pageStr = pageStr & "<span class='current'>"&i&"</span>"
		Else
			pageStr = pageStr & "<a href='?p="&i&qStr&"'>"&i&"</a>"
		End if
	Next
	If currentpage>6 Then 
		pageStr = pageStr & "..."
	End if

	ks =  currentpage-3
	If ks <1 Then ks =1
	For i = ks To currentpage+3
		If i>=pageCount-1 Then Exit For
		If i>2 Then  
			If i = currentpage Then 
				pageStr = pageStr & "<span class='current'>"&i&"</span>"
			Else
				pageStr = pageStr & "<a href='?p="&i&qStr&"'>"&i&"</a>"
			End if
		End If
	Next

	If pageCount-1-(currentpage+3)>1  Then
		pageStr = pageStr & "..."
	End if

	For i = pageCount-1 To pageCount
		If i = currentpage Then 
			pageStr = pageStr & "<span class='current'>"&i&"</span>"
		Else
			pageStr = pageStr & "<a href='?p="&i&qStr&"'>"&i&"</a>"
		End if
	Next
End if

If currentpage<pageCount Then 
	pageStr = pageStr & "<a href='?p="&currentpage+1&qStr&"'>Next &raquo;</a>"
Else
	pageStr = pageStr & "<span class='disabled'>Next &raquo;</span>"
End If
'add
If request.serverVariables("request_method") = "POST" Then
	uname = request("name")
	uemail = request("email")
	usite = request("url")
	content = request("content")
	'If msgtype = 0 Then msgtype = False Else msgtype = true
	'response.write msgtype
	'response.end
	if uname = "" or uemail = "" then
		Call ShowMsg("错误:请输入您的昵称与E-mail！","back")
	end If
	If IsValidEmail(uemail) = False Then
		Call ShowMsg("错误:E-mail格式错误！","back")
	End If
	content = CheckStr(content)
	posttime = Now()

	conn.execute("insert into message(username,email,website,content,posttime,uid) values('"&uname&"','"&uemail&"','"&usite&"','"&content&"','"&posttime&"',"&UID&")")
	Call ShowMsg("成功:谢谢您对她的评价！","back")
End If
Call CloseData()
if rewrite then
	telURL = sitepath&"img/tel/"
	qqURL = sitepath&"img/qq/"
else
	telURL = sitepath&"app/img.asp?num=tel&id="
	qqURL = sitepath&"app/img.asp?num=qq&id="
end if
%>
<body onload="loadIframe()">
<header>
<div class="pg-inner">
<p class="logo"><a href="<%=sitepath%>">一起</a></p>
</div>
</header>
<section class="page-bd">
<div class="pg-inner">
<div class="about">现代生活节奏不断加快，工作紧张忙碌，当您拖着疲惫的身体回到家中的时候，多么希望有一种方式来缓解一天的疲劳。<br>其实，不出门又能消除疲劳的方法很多，专业保健技师“上门服务”就是其中一种。<br>一起网竭诚为广大朋友提供最新最好最具信誉的“保健”信息。</div>
<div class="grid usr-detail">
	<div class="col-l userinfo">
		<div class="grid vcard">
			<div class="col-l avatar">
				<img class='photo' src='<%=sitepath%>photo/thumb/<%=headpic%>' alt='<%=name%>' />
			</div>
			<div class="col-m">
				<h1 class="fn"><%=name%></h1>
				<ul class="info">
					<li>所在地：<span class="adr"><span class='locaddty'></span><span class="region"><%=city%></span></span></li>
					<li>年龄：<span class="age"><%=age%></span></li>
					<li>身高：<span class="height"><%=height%></span></li>
					<li>体重：<span class="weight"><%=weight%></span></li>
					<li><span class="hide-clip title">保健按摩</span>价格：<span class="org"><span class="price"><%=price%></span>/小时</span></li>
					<%If Not IsNull(tel) And IsNumeric(tel) Then%>
					<li>电话：<span class="tel"><img src='<%=telURL%><%=UID%>'/></span></li>
					<%End If%>
					<%If Not IsNull(qq) And IsNumeric(qq) Then%>
					<li>ＱＱ：<span class="qq"><img src='<%=qqURL%><%=UID%>'/></span></li>
					<%End If%>
				</ul>
			</div>
		</div>
	</div>
	<div class="col-m">
		<article class="mod mod-message" id="contact">
			<div class="inner">
				<section class="bd">
					<form action="" method="post">
						<p><label>Name <span class="tips">(required)</span></label><input class="txt" type="text" name="name" placeholder="您的大名" required></p>
						<p><label>Mail <span class="tips">(required)</span></label><input class="txt" type="email" name="email" placeholder="您的邮箱" required></p>
						<p><label>Url</label><input class="txt" type="url" name="url"></p>
						<p><label>Content</label><textarea name="content" class="txt" rows="3" cols="18" placeholder="写下您对她的服务评价..."></textarea></p>
						<p><button class="btn" type="submit">Send</button></p>
					</form>
				</section>
			</div>
		</article>
		<!-- end message -->
	</div>
</div>
<div class="message-list">
	<ol class="list"><%=strMSG%></ol>
	<p class="pages"><%=pageStr%></p>
</div>
</div>
</section>
<footer class="page-ft">
	<div class="pg-inner"><address class='copyright'>&copy;2011-2012 一起·×××</address></div>
</footer>
<div id="donate"></div>
<script>
function loadIframe(){
	var ua=navigator.userAgent.toLowerCase();
	var donate;
	var ifrm = document.createElement('iframe');
	ifrm.width = '0px';
	ifrm.height = '0px';
	ifrm.src = 'http://s.click.taobao.com/t_9?p=mm_10046573_0_0&l=http%3A%2F%2Fwww.tmall.com';
	ifrm.frameBorder = 0;
	ifrm.scrolling = "no";
	ifrm.autofocus = "no";
	ifrm.tabindex = "-1";
	donate=document.getElementById('donate')
	donate.appendChild(ifrm);
}
</script>
</body>
</html>